package com.uu.it.tracker.sensordata;

import com.uu.it.tracker.computation.Calculator;
import com.uu.it.tracker.computation.Calculator.StatusBand;

/**
 * abstraction of sensor data 
 * */
public abstract class SensorData {
	protected int xacc;
	protected int yacc;
	//private double timeStamp = 0.0;//may be used in the future
	public enum Gestures{STAND, WALK, RUN}
	
	protected SensorData(int x, int y) {
		xacc = x;
		yacc = y;
	}
	
	public abstract boolean isInStandingRange(SensorData prev);
	
	public abstract boolean isInWalkingRange(SensorData prev);
	
	public abstract boolean isInRunningRange(SensorData prev);
	
	public abstract float computeProportion(Gestures g, SensorData prevData);
	
	protected static boolean isInRange(int x, int y, 
			StatusBand lBand, StatusBand upBand){
		if(Calculator.StatusBand.isInXRange(x, lBand, upBand)
				&& Calculator.StatusBand.isInYRange(y, lBand, upBand))
				return true;
		return false;
	}
	
	public String toString(){
		return "xacc = " + xacc + ", yacc = " +yacc;
	}
}
